package com.study.demo_jdbctemplate2.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

/**
 * @ClassName: JdbcTemplae
 * @Description:
 * @author: WS
 * @date 2020/12/14
 * @Version: 1.0
 **/
@Configuration
public class JdbcTemplaeConfig {
    @Bean
    JdbcTemplate jdbcTemplate1(@Qualifier("dataSource1") DataSource dataSource){
        return  new JdbcTemplate(dataSource);
    }
    @Bean
    JdbcTemplate jdbcTemplate2(@Qualifier("dataSource2") DataSource dataSource){
        return  new JdbcTemplate(dataSource);
    }
}
